1. Field of the Invention
This invention relates in general to methods of analyzing images to determine in real-time whether an image can be compressed without causing visible anomalies. More specifically, but without restriction to the particular embodiments hereinafter described in accordance with the best mode of practice, this invention relates to methods and software for assessing in the suitability of images for compression.
Portions of the disclosure of this patent document contain material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all rights whatsoever. ATI, and all ATI-based trademarks and logos are trademarks or registered trademarks of ATI, Inc. in the United States and other countries.
2. Background Art
The display of the computer system is thought of as a “frame” in which an image is presented. An image in the frame is decomposed into discrete elements which are termed pixels (picture elements). Pixels are the tiny dots of color on a computer display screen that collectively make up a computer display image. There are a number of color models that are employed to represent the pixels' individual colors. The purpose of a color model is to allow a convenient specification of colors within some color gamut. Typically, each pixel's display color is represented by three color components: red, green, and blue. This particular color model is often called the Red Green Blue (RGB) Color Model. The RGB model employs a unit cube subset of the 3D Cartesian coordinate system to map out the primary colors, with R, G, and B axes and with black (no light) at its origin. Thus, since the model is a unit cube, the axes each have an intensity range between 0 and 1. The primary characteristics are additive meaning that individual contributions of each primary color are added together to yield the resultant pixel color. Each pixel's own individual color characteristics are represented by a specific binary number. Thus, it follows that computer display images are typically represented as a two-dimensional matrix of digital data values.
The process of digitizing images ordinarily generates large amounts of image data. Depending upon the number of pixels in a frame, storing and/or transmitting uncompressed image data will usually require a large amount of computer memory. For this reason, whenever possible, it is advantageous to compress the original image data. Compression of image data improves the performance of video accelerators and reduces the amount of used memory. However, depending upon the particular image being compressed and the type of compression method being applied, compression can degrade the image's visual quality by varying amounts.
There have been various techniques developed in the past to determine whether or not a specific compressed image will be acceptable to use instead of its corresponding original image. However, these past techniques are indiscriminate, which usually causes the unfavorable result of visual artifacts, and/or labor-intensive, which eliminates the ability of real-time use. Most of the existing methods for determining whether a compressed image will appear unflawed to the eye are purely numerical based schemes, and do not take the visual characteristics of the eye into account.
A common numerical-based technique used to determine this is simply the calculation of the average error of the compressed image in absolute magnitude compared to the original non-compressed image. For all of the individual elements of the picture, the average error is the summation of the differences between those elements of the compressed image and all of the elements of the original non-compressed image. This method only accumulates the average overall error of the compressed image. The problem with this method is that it will at times discard acceptable compressed images. This is because there are many compressed images where the average overall error is extremely high, but the images themselves visually appear to the eye to be identical to the original non-compressed image. The reason for this is that, although the actual error is high, in places on the image where there is a great deal of high frequency noise, the eye filters out these visual effects. Thus, only if the compressed image and original image were placed side-by-side, would the eye possibly be able to detect a slight difference. But, at a casual glance, it will not be possible for the eye to be able to distinguish between the two images.
Another existing technique to determine when to compress images is the use of human-intervention to detect image textures that do or do not compress well. This technique is very labor-intensive and, hence, is not suitable for real-time use.
Also, it should be noted that a common method of image compression itself simply consists of applying a single compression method to all images. This method does not perform any analysis of how the images will visually appear after compression has been performed. These types of compression techniques, which do not evaluate the suitability of the compressed image at all, will invariably produce visual artifacts.
A common compression algorithm currently used is the DirectX Texture Compression (DXTC) method. This method codes new pixels from the original image pixels which are grouped into 4×4 pixel blocks. Each new pixel in the block is encoded into two bits. The new pixel's bits represent colors chosen so that they best reproduce the corresponding original pixel's colors. These colors are chosen by the following process. First, two of the original pixels are chosen as the “endpoint colors”, which define a line in the RGB color space. This line is termed the “compression axis”. Then, the remaining pixels in the block are encoded into color values that lie along the line that represent the closest value which lies along the line to the original pixel color. Mathematically, this is accomplished by projecting the original pixel color onto the compression axis. Finally, all of the color values which lie on the compression axis are encoded into two bits, representing four ranges on the compression axis. Hence, each pixel within the 4×4 pixel block is encoded into two bits representing one of these four values.
The DXTC method may not work well for all images. This method does not apply any test to ensure accurate visual representation of the original image. It is only a compression algorithm. If the original colors do not map well, visual artifacts may result.